{php include wl_template('common/header');}
<style type='text/css'>
       .trbody td {text-align: center; vertical-align:top;border-left:1px solid #ccc; border-bottom: 1px solid #ddd;}
</style>
<style>
	.order-rank img{width:16px; height:16px;}
	.js-remark,.js-admin-remark{word-break:break-all; overflow:hidden; background: #FDEEEE;color: #ED5050;padding: 5px 10px;}
	td.goods-info{position:relative; padding-left:60px;}
	.goods-info .img{position:absolute;top:50%; margin-top:-25px; background: url({IMAGE_LOADING}) center center no-repeat; width:50px;height:50px; }
	.goods-info span {white-space: nowrap;overflow: hidden;text-overflow: ellipsis;display: block;}
	.status-text{cursor:pointer;}
	.table>thead>tr>th, .table>tbody>tr>th, .table>tfoot>tr>th, .table>thead>tr>td, .table>tbody>tr>td, .table>tfoot>tr>td {border-top: 1px solid rgba(221, 221, 221, 0);}
</style>
<ul class="nav nav-tabs">
	<li class="active"><a href="javascript:;">提现记录</a></li>
</ul>
<div class="app-content">
<div class="app-table-list">
<div class="panel panel-default">
	<div class="table-responsive">
		<table class="table table-hover" style="min-width: 300px;">
			<thead class="navbar-inner">
				<tr>
					<th class="col-sm-2">申请信息</th>
					<th class="col-sm-2">申请金额</th>
					<th class="col-sm-2">总提成</th>
					<th class="col-sm-2">代理提成<br>系统提成</th>
					<th class="col-sm-9">提现</th>
					<th class="col-sm-2">申请时间</th>
					<th class="col-sm-2">操作时间</th>
					<th class="col-sm-3">状态</th>
					<th class="col-sm-1">单数</th>
				</tr>
			</thead>
			<tbody>
				<tr>
					<td>{if $settlementRecord['type']==1}商家：{$settlementRecord['sName']}{else}代理：{$settlementRecord['aName']}{/if}</td>
					<td>{if $settlementRecord['type']==1}{$settlementRecord['sapplymoney']}{else}{$settlementRecord['aapplymoney']}{/if}元</td>
					<td>
						{if $settlementRecord['type']==1}
						{$settlementRecord['spercent']}
						{else}
						{$settlementRecord['apercent']}
						{/if}%
					</td>
					<td>
						{if $settlementRecord['type']==1}
						{php echo sprintf("%.2f", $settlementRecord['spercent'] - $settlementRecord['apercent'])}%<br>{$settlementRecord['apercent']}%
						{else}0.0000%<br>{$settlementRecord['apercent']}%
						{/if}
					</td>
					<td>{if $settlementRecord['type']==1}<label class="label label-default label-danger">商家销售提现</label>【{if $settlementRecord['type2']==1}超级券{elseif $settlementRecord['type2']==2}拼团{else}抢购{/if}】{/if}
						{if $settlementRecord['type']==2}<label class="label label-default label-danger">VIP申请提现</label>{/if}
						{if $settlementRecord['type']==4}<label class="label label-default label-danger">掌上信息申请提现</label>{/if}
						{if $settlementRecord['type']==3}<label class="label label-default label-danger">一卡通申请提现，待结算</label>{/if}<br><br>{if $settlementRecord['settletype']==1}<label class="label label-default label-success">手动处理{elseif $settlementRecord['settletype']==2}<label class="label label-default label-info">微信零钱{else}<label class="label label-default">未结算{/if}</label>
					</td>
					<td>{php echo date('Y-m-d',$settlementRecord['applytime'])}<br>{php echo date('H:i:s',$settlementRecord['applytime'])}</td>
					<td>{php echo date('Y-m-d',$settlementRecord['updatetime'])}<br>{php echo date('H:i:s',$settlementRecord['updatetime'])}</td>
					<td>{if $settlementRecord['status']==1}<label class="label label-default label-info">代理审核中</label>{/if}
						{if $settlementRecord['status']==2}<label class="label label-default label-danger">系统审核中</label>{/if}
						{if $settlementRecord['status']==3}<label class="label label-default label-success">系统审核通过，待结算</label>{/if}
						{if $settlementRecord['status']==4}<label class="label label-default label-success">已结算到代理</label>{/if}
						{if $settlementRecord['status']==5}<label class="label label-default label-success">已结算到商家</label>{/if}
						{if $settlementRecord['status']==-1}<label class="label label-default label-default">系统审核不通过</label>{/if}
						{if $settlementRecord['status']==-2}<label class="label label-default label-default">代理审核不通过</label>{/if}
					</td>
						<td>
							{$settlementRecord['ordernum']}
						</td>
				</tr>
				<tr>
				<td colspan="9">
					<a href="{php echo web_url('finace/finaceWithdrawalApply/output', array( 'id'=>$settlementRecord['id']));}" class="btn btn-success min-width js-batch js-off-shelves">导出订单核算</a>
				</td>
			</tr>
			</tbody>
		</table>
	</div>
	{if $settlementRecord['type']==1}
	<div class="order-list">
		<div class="panel-body table-responsive collapse in" id="order-template-item-4" style="padding: 0;">
			<table class="table table-bordered">
				<thead style="background-color: #FFFFFF;">
					<tr>
						<th style="width:50px;" class="text-center"><input type="checkbox" onclick="var ck = this.checked;$(':checkbox').each(function(){this.checked = ck});" />全选</th>
						<th style="width:50px">序号</th>
						<th style="width:220px;">商品</th>
						<th style="width:220px; text-align:center;">买家</th>
						<th style="width:120px; text-align:center;">结算状态</th>
						<th style="width:120px; text-align:center;">订单状态</th>
						<th style="width:130px; text-align:center;">金额</th>
					</tr>
				</thead>
				
			</table>
		</div>
		{loop $list $y $item}
		<div class="panel panel-default">
			<div class="panel-heading clearfix" style="padding: 10px 15px;">
				<div class="pull-left">
					<b>商户单号: {$item['orderno']}</b>
					<b>   <a href="javascript:;" data-id="{$item['id']}"  data-url="{$item['transid']}" id="js-copy{$item['id']}" class="js-copy"> | 交易单号: {if $item['transid']}{$item['transid']}{else}暂无{/if}</a> </b>
				</div>
			</div>
			<div class="panel-body table-responsive" style="padding: 0px;">
				<table class="table table-bordered">
					<tbody >
						<tr>
							<td class="text-center" style="width:50px;">
								<center><input type="checkbox" name="checkbox[]" class="checkbox" value="{$item['id']}" /></center>
							</td>
							<td style="width: 50px;" ><center>{php echo $y+1}</center></td>
							<td class="goods-info line-feed" style="width:220px;padding-left: 10px;">
								<div class="img">
									<img class="scrollLoading" src="{IMAGE_PIXEL}" data-url="{php echo tomedia($item['gimg'])}" height="50" width="50" onerror="this.src='{IMAGE_NOPIC_SMALL}'" >
								</div>
								<div class="title" style="padding-left: 60px;">
									<span>商品ID：{$item['id']}</span><br>
									<span>{$item['gname']}</span>
								</div>
							</td>
							<td class="goods-info line-feed" style="width:220px;padding-left: 10px;">
								<div class="img"><img class="scrollLoading" style="width: 100%;height: 100%;" src="{IMAGE_PIXEL}" data-url="{php echo tomedia($item['headimg'])}"></div>
								<div class="title" style="padding-left: 60px;">
									<span>{$item['nickname']}</span>
									<span>{$item['mobile']}</span>
								</div>
							</td>
							<td class="text-center" style="width:120px;">
								{if $item['issettlement']==1}<span class="label label-info">待结算</span>{/if}
								{if $item['issettlement']==2}<span class="label label-success">已结算</span>{/if}
								{if $item['issettlement']==0}<span class="label label-default">未申请</span>{/if}
							</td>
							
							<td class="text-center" style="width:120px;">
								{if $item['paytype']==2}<span class="label label-danger">微信支付</span>{/if}
								{if $item['paytype']==1}<span class="label label-info">余额支付</span>{/if}
							</td>
							<td class="text-center" style="width:130px;">
								总额：{$item['price']}<br>
								实付：{$item['price']}
							</td>
						</tr>
					</tbody>
				</table>
			</div>
		</div>
		{/loop}
	</div>
	{/if}
	{if $settlementRecord['type']==2}
		<div class="panel-body table-responsive">
			<table class="table table-hover">
				<thead class="navbar-inner">
					<tr>
						<th style="width:120px;">用户mid</th>
						<th style="width:120px;">粉丝信息</th>
						<th style="width:180px;">开通时长</th>
						<th style="width:180px;">充值金额</th>
						<th style="width:180px;">所属地区</th>
						<th style="width:120px;">结算状态</th>
						<th style="width:100px;">本次到期时间</th>
						<th style="width:100px;">充值时间</th>
					</tr>
				</thead>
				<tbody>
					{loop $list $item1}
					<tr>
						<td>{$item1['mid']}</td>
						<td>{$item1['member']['nickname']}<br>{$item1['member']['realname']}<br>{$item1['member']['mobile']}</td>
						<td><span style="color: #F26C4F;font-size: 20px;"><b>+</b>{$item1['howlong']} 月</span></td>
						<td>{$item1['price']}</td>
						<td>{$item1['areaName']}</td>
						<td class="text-center" style="width:120px;">
								{if $item1['issettlement']==0}<span class="label label-default">未申请</span>{/if}
								{if $item1['issettlement']==1}<span class="label label-info">待结算</span>{/if}
								{if $item1['issettlement']==2}<span class="label label-success">已结算</span>{/if}
							</td>
						<td>{php echo date("Y-m-d",$item1['limittime']);}</td>
						<td>{php echo date("Y-m-d",$item1['createtime']);}</td>
					</tr>
					{/loop}
				</tbody>
			</table>
		</div>
{/if}
{if  $settlementRecord['type']==3}
<div class="order-list">
		<div class="panel-body table-responsive collapse in" id="order-template-item-4" style="padding: 0;">
			<table class="table table-bordered">
				<thead style="background-color: #FFFFFF;">
					<tr>
						<th style="width:150px;text-align:center;">用户信息</th>
						<th style="width:150px;text-align: center;">用户电话</th>
						<th style="width:100px; text-align:center;">充值时长</th>
						<th style="width:100px; text-align:center;">订单金额</th>
						<th style="width:100px; text-align:center;">结算状态</th>
						<th style="width:110px; text-align: center;">支付时间</th>
					</tr>
				</thead>
			</table>
		</div>
		<div class="panel panel-default">
			<div class="panel-body table-responsive" style="padding: 0px;">
				<table class="table table-bordered">
					<tbody >
					{loop $list $y $item}
						<tr>
							<!--一卡通内容-->
							<td class="goods-info line-feed" style="width:150px;padding-left: 10px;height: 60px;">
								<div class="img"><img src="{IMAGE_PIXEL}" class="scrollLoading" data-url="{php echo tomedia($item['avatar'])}" height="50" width="50" ></div>
								<div class="all-tips" style="margin-left: 50px;">
									<p class="" style="font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif;">{$item['nickname']}</p>
								</div>
							</td>
							<!--用户信息-->
							<td class="text-center" style="width:150px;font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif;">
								{$item['mobile']}						
							</td>
							<!--创建时间-->
							<td class="text-center" style="width:100px;font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif;">
								{$item['howlong']}天						
							</td>
							<!--核销时间-->
							<td class="text-center" style="width:100px;font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif;" >
								{$item['price']}元
							</td>
							<td class="text-center" style="width:100px;font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif;" >
								{if $item['issettlement']==0}<span class="label label-info">未申请</span>{/if}
								{if $item['issettlement']==1}<span class="label label-info">待结算</span>{/if}
								{if $item['issettlement']==2}<span class="label label-success">已结算</span>{/if}
							</td>
							<!--验证码-->
							<td class="text-center" style="width: 110px;">
								{php echo date('Y-m-d H:i:s',$item['paytime'])}						
							</td>
						</tr>
						{/loop}
					</tbody>
				</table>
			</div>
		</div>
	</div>
{/if}
</div>
</div>
</div>
{php include wl_template('common/footer');}